/*
 * joystick.h
 *
 *  Created on: 18-10-2012
 *      Author: Skeith
 */

#ifndef JOYSTICK_H_
#define JOYSTICK_H_

#include "../Startup/general.h"
#include "../Startup/lpc2xxx.h"

#define JOY_PINS (1 << 8 | 1 << 9 | 1 << 10 | 1 << 11 | 1 << 12)

#define JOY_DIR (~(JOY_PINS))
#define JOY_UP (1 << 10)
#define JOY_DOWN ( 1 << 12)
#define JOY_LEFT ( 1 << 9)
#define JOY_RIGHT ( 1 << 11)
#define JOY_CENTER (1 << 8)

#define JOY_PINSEL_MASK (1 << 16 | 1 << 17 | 1 << 18 | 1 << 19 | 1 << 20 | 1 << 21 | 1 << 22 | 1 << 23 | 1 << 24 | 1 << 25)


void JoyInit(void);
tBool JoyIsUp(void);
tBool JoyIsDown(void);
tBool JoyIsLeft(void);
tBool JoyIsRight(void);
void JoySetPinsel(void);

#endif /* JOYSTICK_H_ */
